// 信息模块model定义

package models

import (
	"time"
)

// 文章
type Content struct {
	Id        uint32 `json:"id" orm:"auto;pk"`
	NaviId    uint32 `json:"naviId" label:"从属菜单"`
	UserId    uint32 `json:"userId" label:"发布人"`
	Title     string `json:"title" orm:"size(20)" label:"标题"`
	Abstract  string `json:"abstract" label:"摘要"`
	Content   string `json:"content" orm:"type(text)" label:"内容"`
	MarkImg   string `json:"markImg" label:"封面图"`
	Recommend bool   `json:"recommend" label:"首页推荐"`
	BrowseNum uint32 `json:"browseNum" label:"浏览次数"`
	LikeNum   uint32 `json:"likeNum" label:"点赞次数"`
	ShareNum  uint32 `json:"shareNum" label:"分享次数"`
	ShareUrl  string `json:"shareUrl" label:"分享链接"`
	Sequ      uint32 `json:"sequ" label:"显示顺序"`

	AddTime time.Time `json:"addTime" orm:"type(datetime);auto_now_add"`
}

// 通知公告
type Notice struct {
	Id      uint32 `json:"id" orm:"auto;pk"`
	UserId  uint32 `json:"userId" label:"发布人"`
	Title   string `json:"title" orm:"size(20)" label:"标题"`
	Content string `json:"content" orm:"type(text)" label:"内容"`
	Sequ    uint32 `json:"sequ" label:"显示顺序"`

	AddTime   time.Time `json:"addTime" orm:"type(datetime);auto_now_add"`
	BeginTime time.Time `json:"beginTime" label:"开始时间"`
	EndTime   time.Time `json:"endTime" label:"结束时间"`
}

// 轮播图
type Image struct {
	Id     uint32 `json:"id" orm:"auto;pk"`
	UserId uint32 `json:"userId" label:"发布人"`
	Title  string `json:"title" orm:"size(20)" label:"标题"`
	Src    string `json:"src" label:"图片路径"`
	Sequ   uint32 `json:"sequ" label:"显示顺序"`

	AddTime time.Time `json:"addTime" orm:"type(datetime);auto_now_add"`
}
